package demo3;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86138
 * Date: 2024-06-04
 * Time: 10:15
 */
//向上转型
public class Test {
    public static void func(Animal animal){

    }

    public static Animal func2(){
        Animal dog = new Dog("w",3);
        return dog;
    }

    public static void main(String[] args) {
        /*Dog dog = new Dog("w",3);
        dog.bark();*/

        //1.
        //Animal animal = new Dog("w",3);

        //2.传参
//        Animal dog = new Dog("w",3);
//        func(dog);

        //3.返回值
        Animal animal = func2();

    }
}
